//
//

#pragma once

#include <float.h>
#include <math.h>
#include <map>
#include <vector>
#include <exception>


#pragma warning(disable:4251)

using std::vector;
using std::map;

#ifdef GEOMETRIC_EXPORTS
#define _GEOMETRIC __declspec(dllexport)
#else
#define _GEOMETRIC __declspec(dllimport)
#endif


// math const:pi
#define MATH_CONST_PI			3.141592657
// math const:2*pi
#define MATH_CONST_2PI			6.283185314
// math const:pi/2
#define MATH_CONST_PI_DIV2		1.5707963285
// zero/positive/negative number sign
#define MATH_SIGN_ZRO			0
#define MATH_SIGN_POSITIVE		1
#define MATH_SIGN_NEGATIVE	   -1

// vector clockwise direction
#define VECTOR_CLW_FORWARD		0
#define VECTOR_CLW_REVERSE		1
#define VECTOR_CLW_PARALLEL		2

// convex polygon or concave polygon
#define POLYGON_TYPE_INVALID	0	
#define POLYGON_TYPE_CONVEX		1	
#define POLYGON_TYPE_CONCAVE	2

// point location to polygon
#define POINT_LCT_INSIDE		0
#define POINT_LCT_ON			1
#define POINT_LCT_OUTSIDE		2

// line-line relationship
#define LINE_LINE_INTERSECT		0
#define LINE_LINE_OVERLAP		1
#define	LINE_LINE_PARALLEL		2

// segment-segment relationship
#define SEG_SEG_NOT_INTERSECT	0
#define SEG_SEG_INTERSECT		1
#define SEG_SEG_OVERLAP			2
#define SEG_SEG_PARALLEL		3

// ray-ray relationship
#define RAY_RAY_NOT_INTERSECT	0
#define RAY_RAY_INTERSECT		1
#define RAY_RAY_OVERLAP			2
#define RAY_RAY_SAME_PARALLEL	3
#define RAY_RAY_OPP_PARALLEL	4

// line-segment relationship
#define LINE_SEG_NOT_INTERSECT	0
#define LINE_SEG_INTERSECT		1
#define LINE_SEG_OVERLAP		2
#define LINE_SEG_PARALLEL		3

// line-ray relationship
#define LINE_RAY_NOT_INTERSECT	0
#define LINE_RAY_INTERSECT		1
#define LINE_RAY_OVERLAP		2
#define LINE_RAY_PARALLEL		3

// segment-ray relationship
#define SEG_RAY_NOT_INTERSECT	0
#define SEG_RAY_INTERSECT		1
#define SEG_RAY_OVERLAP			2
#define SEG_RAY_PARALLEL		3
#define SEG_RAY_SAME_PARALLEL	4

//


// max & min
#define MAX(a,b)	((a) > (b) ? (a) : (b))
#define MIN(a,b)	((a) < (b) ? (a) : (b))


